var express = require('express');
var path = require('path');
var jsData = require(__dirname + '/data/data.json');

var app = express();
app.use(express.static(path.join(__dirname + '/public')));

app.get('/questions', function (req, res) {
    res.json({
        date: (new Date()).toString(),
        data: jsData
    });
});


var server = app.listen(3000, function () {

    var host = server.address().address;
    var port = server.address().port;

    console.log('Example app listening at http://%s:%s', host, port);
});

module.exports = app;
